﻿
function ToggelNode(NodeId, PanelId, CollapseCss, ExpandCss) {

    $("#" + PanelId).toggle('fast');

    if ($("#" + NodeId).hasClass("" + CollapseCss + "")) {
        $("#" + NodeId).removeClass("" + CollapseCss + "");
        $("#" + NodeId).addClass("" + ExpandCss + "");
    }
    else {
        $("#" + NodeId).removeClass("" + ExpandCss + "");
        $("#" + NodeId).addClass("" + CollapseCss + "");
    }

}

function ToggleNodes() {
    $('div[isNode=true]').slideToggle('fast');
}

function OnTreeRbClick(DIV_ID, RB_ID, SelectedNodeID,isRbMode) {

    if (isRbMode) {
        $("div#" + DIV_ID + " :input").each(function() {
            this.checked = false;
        });
        
        var v = $("#" + RB_ID)[0];
        $(v).attr("checked", "true");
    }
    
    
    var SelectedNodeList = "";
    $("div#" + DIV_ID + " :input[checked=true]").each(function() {
        SelectedNodeList = SelectedNodeList + this.id + ",";
    }
    );

    $("#" + SelectedNodeID)[0].value = "";
    $("#" + SelectedNodeID)[0].value = SelectedNodeList;

}